import request from "./request"
//请求类列表接口
function getcategories(params) {
    return request.get("categories", params)
}
//请求添加类列表接口
function getaddcategories(params) {
    return request.post("categories", params)
}
//请求删除类列表接口
function getdelcategories(id) {
    return request.delete(`categories/${id}`)
}
//请求编辑类列表接口
function geteditcategories(params) {
    return request.put(`categories/${params.id}`, { cat_name: params.cat_name })
}
//请求分类参数列表参数
function getcategoriesList(params) {
    return request.get(`categories/${params.id}/attributes?sel=${params.sel}`)
}

//请求分类删除动态&&静态参数
function getcategoriesdelm(params) {
    return request.delete(`categories/${params.id}/attributes/${params.attrid}`)
}
//请求分类添加动态&&静态参数
function getcategoriesdtadd(params) {
    return request.post(`categories/${params.id}/attributes`,params)
}

//请求分类编辑动态&&静态参数
function getcategoriesdtedit(params) {
    return request.put(`categories/${params.id}/attributes/${params.attrId}`,params)
}
//添加tag标签
function getcategoriesdtaddtsg(params) {
    return request.put(`categories/${params.id}/attributes/${params.attrId}`,params)
}



export {
    getcategories, getaddcategories, getdelcategories,
    geteditcategories, getcategoriesList,getcategoriesdelm,
    getcategoriesdtadd,getcategoriesdtedit,getcategoriesdtaddtsg
}